Micron Document
Fox's Git Mirrors


Displaying Raw • Download

examples/wasm/vendor/github.com/quic-go/quic-go/internal/protocol/perspective.go 83609bcb589eb3cfc35b98ecc0b3327b2ae99d77 (83609bcb) Text, 501 B

package protocol

// Perspective determines if we're acting as a server or a client
type Perspective int

// the perspectives
const (
PerspectiveServer Perspective = 1
PerspectiveClient Perspective = 2
)

// Opposite returns the perspective of the peer
func (p Perspective) Opposite() Perspective {
return 3 - p
}

func (p Perspective) String() string {
switch p {
case PerspectiveServer:
return "server"
case PerspectiveClient:
return "client"
default:
return "invalid perspective"
}
}

Served by rngit 1.5.2 - Generated in 0.02s